package com.jlu.mybatis_plus.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.util.Date;

@Data
public class User {
//  MyBatis-Plus默认的主键策略是：ASSIGN_ID （使用了雪花算法）
  @TableId(type = IdType.ASSIGN_ID)
  private Long id;
  private String name;
  private Integer age;
  private String email;

  @TableField(fill = FieldFill.INSERT)
  private Date createTime;  //create_time

  @TableField(fill = FieldFill.INSERT_UPDATE)
  private Date updateTime; //update_time

  @Version
  @TableField(fill = FieldFill.INSERT)
  private Integer version;

  @TableLogic
  @TableField(fill = FieldFill.INSERT)
  private Integer deleted;
}
